﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
    public partial class Form3 : Form
    {
        public Form3()
        {
            InitializeComponent();
        }

        private void Form3_Load(object sender, EventArgs e)
        {

        }

        private void button2_Click(object sender, EventArgs e)
        {
            var uid = textBox1.Text;
            var pwd = textBox2.Text;
            var repwd = textBox3.Text;

            var hasUid = !string.IsNullOrEmpty(uid);
            var hasPwd = !string.IsNullOrEmpty(pwd);
            var eaPwd = pwd == repwd;

            if (hasUid != null && hasPwd != null && eaPwd )
            {
                MessageBox.Show("注册成功");

                Form1.user.Add(uid, pwd);
                Form1 form1 = new Form1();
                form1.Show();
            }
            else
            {
                MessageBox.Show("注册失败");
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
